package siddur.traktask.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import siddur.traktask.entity.Memo;
import siddur.traktask.entity.TaskInfo;

public interface MemoRepository extends CrudRepository<Memo, Long>{

	@Query("select t from Memo t where t.task = :task and t.createdAt between :startAt and :endAt")
	List<Memo> findBetween(@Param("startAt") Date startAt, 
			@Param("endAt") Date endAt, 
			@Param("task") TaskInfo task);
}
